//
//  Number.m
//  MathMastersAsteroids
//
//  Created by Jordon Phillips on 3/7/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "Number.h"


@implementation Number

@synthesize value, explosion, explode;

//initilizes the number to the proper starting values
- (void)initNumber:(float)newX:(float)newY:(int)newValue{
	[super init];
	self.value = newValue;
	self.xPos = newX;
	self.yPos = newY;
	self.sprite = [[Sprite alloc] init];
	self.sprite.xPos = self.xPos;
	self.sprite.yPos = self.yPos;
	self.sprite.scale = 25;
	self.sprite.image = (3+value);
	self.explosion = [[Sprite alloc] init];
	self.explosion.xPos = self.xPos;
	self.explosion.yPos = self.yPos;
	self.explosion.scale = 25;
	self.explosion.image = 20;
	[self.explosion setDimensions:3];
}

//moves the number in the x axis
-(void)moveX:(GLfloat)amount{
	self.xPos+=amount;
	self.sprite.xPos+=amount;
	self.explosion.xPos+=amount;
}

-(void)dealloc{
	[explosion dealloc];
	[super dealloc];
}
@end
